package com.wtb.javatool.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wtb.javatool.dao.CourseMapper;
import com.wtb.javatool.entity.Course;
import com.wtb.javatool.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourceServiceImpl extends ServiceImpl<CourseMapper,Course> implements CourseService {

    @Autowired
    private CourseMapper courseMapper;

    //根据bandId查询
    @Override
    public List<Course> getCourseById(Long id){return courseMapper.getCourseById(id);}

    //根据subjectId查询
    @Override
    public List<Course> getCourseBySubjectId(Long subjectId) {
        return courseMapper.getCourseBySubjectId(subjectId);
    }

    //更新
    @Override
    public int update(Course course) {
        return courseMapper.update(course);
    }

    //根据bandId删除
    @Override
    public int deleteByBandId(Long bandId){
        return courseMapper.deleteByBandId(bandId);
    }
}
